<?php
	defined('_JEXEC') or die('Restricted access');
	require_once(CUTEENGINE_BASE_FIELD_PATH."base_field_class.php");
    
	//
    // t_field_form
    //
	class t_field_form extends t_base_field
	{
        
        // property declaration
		// protected

        

        // property declaration
		// public
		// G
		const language_position_last = 1;
		
		// P
        const proper_properties_position_last = 1;

        // method declaration
    	// protected
		// C
        // G
		protected function get_field_event_script($a_event_type,$a_argouments)
        {			
			//echo "a_event_type:$a_event_type<BR>";
			$local_return = '';
			$local_event = $this->events[$a_event_type];
			
			switch ($local_event->event_type) 
            {
                /***********  t_base_field::field_event_type_on_selected  ***********/
                case t_base_field::field_event_type_on_selected:
				break;
                /***********  t_base_field::field_event_type_on_edit  ***********/
                case t_base_field::field_event_type_on_edit:
                case t_base_field::field_event_type_on_cancel:
                case t_base_field::field_event_type_on_save:
				case t_base_field::field_event_type_on_insert:
				break;                
			}
			return $local_return;
		}
static function get_help_proper_property($a_index)
		{
			$local_return = 'NO HELP AVAILABLE';
			/*switch ($a_index) 
            {
                case self::proper_properties_position_:
					$local_return = '';
				break;                
			}*/
			return $local_return;
		}
        static function get_default_proper_property($a_index)
		{
			$local_return = '';
			/*switch ($a_index) 
            {
                case self::proper_properties_position_:
					$local_return = 'TRUE';
				break;                
			}*/
			return $local_return;
		}
		protected function get_proper_properties_position_last()      
		{
            return self::proper_properties_position_last;
        }
		
	
		
        // method declaration
    	// public
        public function __construct($a_parent_part,$a_common_properties_str, $a_proper_properties_str)
		{
            parent::__construct($a_parent_part,$a_common_properties_str, $a_proper_properties_str);
            
			
		}
public function initialize_main_tag()
        {	
           // $this->main_tag = parent::get_parent_tag(); 
			$local_name = $this->common_properties_array[t_base_field::common_properties_position_per_field_name];
			$local_current_tag = parent::add_tag(t_base_tag_type::btt_div,
                $local_name);
			$this->main_tag = $local_current_tag;
		}
        // C
		public function create_tags_structure()
        {
            //echo __METHOD__."<BR>";
            global $g_javascript_namespace;
			parent::create_tags_structure();
			// method

			// component
            
           /* 
				$local_name = $this->common_properties_array[t_base_field::common_properties_position_per_field_name];
				$local_current_tag = parent::add_tag(t_base_tag_type::btt_div,
					$local_name);
			$this->main_tag = $local_current_tag;*/
            $this->default_start_tag = $this->main_tag;
            $this->default_result_tag = $this->main_tag;
            // label style
            $this->add_style_sheet_property("#".$this->main_tag->name."","width","700px");
            $this->add_style_sheet_property("#".$this->main_tag->name." label","display","block");
            $this->add_style_sheet_property("#".$this->main_tag->name." label","width","100%");
            // input, textarea style
            $this->add_style_sheet_property("#".$this->main_tag->name." input, textarea","display","block");
            $this->add_style_sheet_property("#".$this->main_tag->name." input, textarea","width","70%");
            $this->add_style_sheet_property("#".$this->main_tag->name." input, textarea","margin-right","10px");
            $this->add_style_sheet_property("#".$this->main_tag->name." input, textarea","margin-left","10px");
            $this->add_style_sheet_property("#".$this->main_tag->name." input, textarea","margin-bottom","10px");

            // button style
            $this->add_style_sheet_property("#".$this->main_tag->name." button","display","block");
            $this->add_style_sheet_property("#".$this->main_tag->name." button","padding","3px");
            
            
        }
		public function create_javascript_initialization_component()
		{
			global $g_javascript_namespace;
            global $g_strings_utility_namespace;
			// Methods    
			// P
			/*$g_javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),'prepare_childs_values_to_send','',"
	var local_result = '';
	var local_parent = ".t_cuteengine::javascript_instance_name.".html_tag(this.name);
	var e = 0;
	for (var i = 0; i < local_parent.childNodes.length; i++) 
	{
		var child = local_parent.childNodes[i];
		if ((child.nodeName == 'INPUT') || (child.nodeName == 'TEXTAREA'))
		{
			var local_ce = ".t_cuteengine::javascript_instance_name."[child.id];
            if ((local_ce != undefined) && (local_ce.check_value != undefined) &&  (!local_ce.check_value()))
                return false;
            ".$g_strings_utility_namespace->get_javascript_code_to_hide_separetor("e","local_result","child.value")."
			e++;
		}
	} 
	return local_result;
	");*/
		}
        
		// G
		public function get_language_position_last()
        {
            return self::language_position_last;
        }
		public function get_result_action_script($a_event_type,$parent_event_type,
            $a_parameter,$a_content_loader_result)
		{
            return '';
        }
		// I
		public function initialize_field_event($a_event_type)
        {	
			//echo "ciao";
		}
    }
?>    